<?php
	function __autoload($class_name)
	{
		include_once('../classes/'.strtolower($class_name).'.php');
	}
    
    $Loi = false;
	$TenLoaiSanPham = $_POST['TenLoaiSanPham'];
		    
    $loaisanpham = new loaisanphambs();
    $loaisanpham->TenLoaiSanPham = $TenLoaiSanPham;
    $isset = $loaisanpham->issetType();
    
    if($isset[0]['SoDong'] > 0)
        $Loi = true;
    
    if($Loi == false)
    {
        $loaisanpham->add();
        echo "yes";
    }
    else
    {
        echo "no";
    }
?>